import Vue from "vue"
import Router from "vue-router"
import HomeComp from "../components/Home"
import LoginComp from "../components/Login"
import RegisterComp from "../components/Register"
import Course from "../components/Course"
import Detail from "../components/Detail.vue";
import Cart from "../components/Cart.vue";
Vue.use(Router);

export default new Router({
    // 设置路由模式为‘history’，去掉默认的#
    mode: "history",
    routes:[
        // 路由列表
        {
            name:"Home",
            path:"/",
            component:HomeComp,
        },
        {
            name:"HomePage",
            path:"/homePage",
            component:HomeComp,
        },
        {
            name:"Login",
            path:"/user/login",
            component:LoginComp,
        },
        {
            name: "Register",
            path:"/user/reg",
            component: RegisterComp
        },
        {
            name: "Course",
            path: "/course",
            component:Course
        },
        {
            path: '/courses/:id',
            name: 'Detail',
            component: Detail,
        },
        {
            path: '/cart',
            name: 'Cart',
            component: Cart,
        },
    ]
})
